﻿Imports SponsorshipLogic
Imports SponsorshipLogic.Relationship

Public Class RelationshipsManager
    Private WithEvents _RelationshipsCtrl As ctlRelationships
    Public Sub New()

    End Sub

    Public Sub New(ByVal RelationshipsCtrl As ctlRelationships)
        _RelationshipsCtrl = RelationshipsCtrl
    End Sub
    Public Function Fill() As Integer
        Dim dt As New DataTable
        Dim Ret As Integer = GetRelationships(_RelationshipsCtrl.Filter, dt)
        _RelationshipsCtrl.DataTable = dt
        Return Ret
    End Function

    Private Sub _RelationshipsCtrl_OpenRelationship(ByVal Id As Integer) Handles _RelationshipsCtrl.OpenRelationship
        Throw New NotImplementedException
    End Sub



    'Dim Rows As Integer
    'Dim dt As New DataTable
    'Dim lFilter As SponsorshipLogic.Relationship.State
    'Select Case Relationships1.Filter
    '    Case FilterEnum.All
    '        lFilter = SponsorshipLogic.Relationship.State.All
    '    Case FilterEnum.Unknown
    '        lFilter = SponsorshipLogic.Relationship.State.Unknown
    '    Case FilterEnum.Active
    '        lFilter = SponsorshipLogic.Relationship.State.Active
    '    Case FilterEnum.Terminated
    '        lFilter = SponsorshipLogic.Relationship.State.Terminted

    'End Select
    'Rows = SponsorshipLogic.Relationship.GetRelationships(lFilter, dt)
    'With Relationships1
    '    .DataTable = dt
    'End With



    Private Sub _RelationshipsCtrl_Reload() Handles _RelationshipsCtrl.Reload
        Dim Ret As Integer = Fill()
    End Sub
End Class
